home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v8n19.arc
/
ENUMLAST.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-10-17
|
591b
|
34 lines
ENUMLAST.PAS
PROGRAM Enumerated;
(* Insert more items in the enumerated type "Fruit". The
program will still correctly display the ordinal values
of all the items.*)
TYPE
Fruit = (Apple, Orange, Grape, Pineapple);
FruitRay = array[Fruit] of byte;
CONST
FirstFruit = Fruit(0);
LastFruit = Fruit(sizeof(FruitRay)-1);
PROCEDURE ShowAllFruits;
VAR
F : Fruit;
BEGIN
WriteLn('Here are the ordinal values of all the fruits:');
For F := FirstFruit To LastFruit DO
Write( Ord(F):3 );
WriteLn;
END;
BEGIN
ShowAllFruits;
END.